/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package websom;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.LinkedList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Teddy
 */
public class Stopwords {

    private static Stopwords _instance = new Stopwords();
    private List<String> stopwordsList = new LinkedList<String>();

    private Stopwords() {
        InputStream is = null;
        InputStreamReader isr = null;
        BufferedReader br = null;
        try {
            is = getClass().getResourceAsStream("/settings/stopwords.txt");
            isr = new InputStreamReader(is);
            br = new BufferedReader(isr);
            String line;
            while ((line = br.readLine()) != null) {
                stopwordsList.add(line);
            }
        } catch (IOException ex) {
            Logger.getLogger(Stopwords.class.getName()).log(Level.SEVERE, null, ex);
        } finally {
            try {
                br.close();
                isr.close();
                is.close();
            } catch (IOException ex) {
                Logger.getLogger(Stopwords.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }

    public static Stopwords getInstance() {
        return _instance;
    }

    public List<String> getStopwordsList() {
        return stopwordsList;
    }


}
